package com.java2_27;

//枚举类的定义形式(JDK5之前的方式)
public class MyEnumerate {
    private final String name;
    private final int month;

    private MyEnumerate(String name, int month) {
        this.name = name;
        this.month = month;
    }

    public static final MyEnumerate SPRING = new MyEnumerate("春天", 1212);
    public static final MyEnumerate SUMMER = new MyEnumerate("夏天", 345);
    public static final MyEnumerate AUTUMN = new MyEnumerate("秋天", 678);
    public static final MyEnumerate WINTER = new MyEnumerate("冬天", 91011);

    public String getName() {
        return name;
    }


    public int getMonth() {
        return month;
    }

    @Override
    public String toString() {
        return "MyEnumerate{" +
                "name='" + name + '\'' +
                ", month=" + month +
                '}';
    }
}
